package com.yuqingsong.algorithm.sort;

import java.util.Arrays;
import java.util.Comparator;

public abstract class AbstractSort<T> implements Sort<T> {
	
	
	/**
	 * 用于比较数组元素大小
	 */
	protected Comparator<? super T> comp;
	
	public void init(Comparator<? super T> comp){
		this.comp = comp;
	}
	
	public void print(T[] array){
		System.out.println(Arrays.toString(array));
	}
	
	public void swap(T[] array,int i ,int j){
		T temp = array[i];
		array[i] = array[j];
		array[j] = temp;
	}
	
}
